<?php
/**
 * 接触测肤检测仪 会美女神 数据
 *
 * Author: Lyun
 * Editor: Zeon
 * Date: 2018/5/18
 * Created by Panxsoft.
 */

namespace App\Services\Presenters;

use App\Exceptions\ApiErrCode;
use App\Exceptions\ApiException;
use App\Models\Customer\CustomerRelateHmSkin;
use App\Models\Customer\HmSkinSuggest;
use App\Models\Store\HmSkinRecord;
use App\Models\Customer\Language as ModelLanguage;
use Illuminate\Database\Eloquent\Collection;

class HmSkinData
{
    public static $hm_suggests;

    const HM_WATER = 1; // 检测水分
    const HM_OIL = 2;   // 检测油分
    const HM_FLEX = 3;  // 检测弹性

    const HM_ITEM_MAP = [
        self::HM_WATER, self::HM_OIL, self::HM_FLEX
    ];

    const HM_ITEM_NAME_MAP = [
        self::HM_WATER => 'water', self::HM_OIL => 'oil', self::HM_FLEX => 'flex'
    ];

    const HM_DETECTION_LEVEL_MAP = [
        self::HM_WATER => [5, 10, 30, 40, 50, 60],
        self::HM_OIL => [5, 10, 15, 18, 25, 30],
        self::HM_FLEX => [1, 3, 4, 6, 8]
    ];

    const REPORT_MAP = [
        self::ZH => [
            'age'   => [
                '年轻就是资本，满满胶原蛋白，为你打call!',
                '确认过眼神，你目前皮肤状态良好。',
                '胶原蛋白在慢慢流失了，要学会“diss”它',
                '皮肤有点松弛了，稳住，你能赢的！',
                '肌肤水分流失严重，皮肤松弛，扎心了，老铁！',
            ],
            'water' => [
                self::WATER_LABEL_5 => [
                    'title'    => '非皮肤水分',
                    'analysis' => '非皮肤水分。接触皮肤时没有按压紧仪器设备或者测试部位并非人体测肤指定部位导致数据并非人体皮肤数据，人体真实的皮肤含水量不会出现此数据。请按正常的操作方式进行测肤和重新测试此部位皮肤。',
                    'suggest'  => '重新测试此部位皮肤。由于测肤时，测试人员未按压好测肤仪器导致智能测肤仪器与皮肤接触不恰当，或测试部位并非人体测肤指定部位导致数据不正常。',
                ],
                self::WATER_LABEL_10 => [
                    'title'    => '肌肤干燥',
                    'analysis' => '肌肤干燥。年龄增长、环境影响、清洁过度、睡眠不足、洗剂用品碱性强等是导致皮肤干燥的重要原因。皮肤深层水分大量减少，毛孔舒张分泌大量油分，表层呈现粗糙干燥，局部会出现干裂、发痒，若是抓痒，会导致皮肤有伤口，引起发炎形成青春痘。',
                    'suggest'  => '以温和产品清洁皮肤，日常多使用爽肤水或保湿乳对皮肤补水，每天睡前做一次补水面膜或精华按摩。若肌肤吸收能力差，使用高浓度补水原液和滋润护肤品。日常多饮水，忌油腻辛辣，食用维生素E、A、和B2的食物如卷心菜、动物肝脏、鸡蛋和牛奶等。',
                ],
                self::WATER_LABEL_30 => [
                    'title'    => '水分不足',
                    'analysis' => '水分不足。年龄增长、环境影响、清洁过度、睡眠不足、洗剂用品碱性强等是导致皮肤流失水分的重要原因。皮肤水分流失会导致毛孔轻度舒张，释放更多的油分，肌肤也相应变得粗糙。肤色呈现暗沉泛黄，对护肤品开始有不适感和不易吸收。',
                    'suggest'  => '你的肌肤轻微缺水，保证充足睡眠和基本的皮肤护理，日常注意防护空调、阳光等对皮肤影响，每周可以去做一次面膜和去角质，敏感皮肤可不去角质。日常使用爽肤水或保湿乳进行补水，多饮水和多吃新鲜的蔬菜、水果、鸡蛋和牛奶等。',
                ],
                self::WATER_LABEL_40 => [
                    'title'    => '水分良好',
                    'analysis' => '水分良好。日常注意皮肤护理和保养，避免环境影响、保持充足睡眠等良好的生活习惯使皮肤水分良好。皮肤表层含水量高，毛孔展开程度小，分泌油分充足，表层锁水能力强。皮肤呈现光滑细嫩，红润通透，肌肤吹弹可破。',
                    'suggest'  => '保持当前良好的作息习惯和饮食方式，夏季多用补水控油的产品，冬季使用清爽型乳液精华等产品。适当饮水，每天饮水1200ml以上。可食用一些改善水分的食品如蜂蜜、猕猴桃、苹果等，忌辛辣油腻食品。',
                ],
                self::WATER_LABEL_50 => [
                    'title'    => '化妆品影响',
                    'analysis' => '化妆品影响。测试部位的表层存在着化妆品或护肤品大量残留，导致当前测肤数据水分大于50%，当前数据不能完全真正体现此部位皮肤的水分情况。最好选取一块化妆品或护肤品残留较少的部位重新测肤。',
                    'suggest'  => '重新选取其他位置进行测肤。由于残留的大量护肤品或化妆品，测肤得出的数据不真实。最好重新选取一块化妆品或护肤品残留较少的部位重新测肤。',
                ],
                self::WATER_LABEL_60 => [
                    'title'    => '非皮肤水分',
                    'analysis' => '非皮肤水分。测试部位的表层存在大量水分或并非人体测肤指定部位导致皮肤数据显示水分大于60%，正常被测试的皮肤部位不可能存在此数据。请保持测试部位净洁无汗，并按正常的操作方式进行重新测试。',
                    'suggest'  => '重新测试此部位皮肤。由于测肤时，测试部位的表层存在大量水分或并非人体测肤指定部位导致数据不正常。在测肤前请保持测试部位净洁无汗，且测试部位正确。',
                ],
            ],
            'oil'   => [
                self::OIL_LABEL_5 => [
                    'title'    => '非皮肤油分',
                    'analysis' => '非皮肤油分。接触皮肤时没有按压紧仪器设备或者测试部位并非人体测肤指定部位导致数据并非人体皮肤数据，人体真实的皮肤油分不会出现此数据。请按正常的操作方式进行测肤和重新测试此部位皮肤。',
                    'suggest'  => '重新测试此部位皮肤。由于测肤时，测试人员未按压好测肤仪器导致智能测肤仪器与皮肤接触不恰当，或测试部位并非人体测肤指定部位导致数据不正常。',
                ],
                self::OIL_LABEL_10 => [
                    'title'    => '营养不良',
                    'analysis' => '营养不良。受环境、作息混乱、饮食油腻辛辣、护理清洁不当等原因影响导致肌肤吸收营养不良，血液循环变慢，水分和油分流失严重。皮肤表层无法受到水分和油分保护，肌肤呈现局部干硬，形成角质死皮，粗糙形成皱纹。',
                    'suggest'  => '日常对皮肤进行深度清洁，去除多余的角质和死皮。夏季多用补水控油的产品，冬季多用清爽型乳液精华等产品。忌抽烟喝酒熬夜，日常饮水1200ml以上。饮食上以清淡为主，忌辛辣油腻的食物，多吃一些新鲜水果和蔬菜。',
                ],
                self::OIL_LABEL_15 => [
                    'title'    => '缺油',
                    'analysis' => '皮肤轻度缺油。受环境、作息混乱、饮食油腻辛辣、护理清洁不当等原因影响导致肌肤吸收营养速率变慢，血液循环出现轻微阻碍，皮肤水分丢失，毛孔展开分泌油分不足，皮肤呈现局部干燥缺油的状态。',
                    'suggest'  => '对皮肤表层进行有效清洁，去除多余的角质和死皮。日常护理中可使用补水控油成分的护理产品如乳液、精华、霜类产品等。保证平常睡眠质量，不抽烟喝酒，多饮水。饮食以清淡为主，忌辛辣油腻，多食用一些新鲜水果和蔬菜。',
                ],
                self::OIL_LABEL_18 => [
                    'title'    => '油分良好',
                    'analysis' => '油分良好。日常注意皮肤护理和保养，避免环境影响、保持充足睡眠等良好的生活习惯使皮肤油分良好。皮肤表层水分良好，毛孔展开程度小，皮肤体液饱满细胞充实、新陈代谢正常、血液循环好，分泌油分充足。',
                    'suggest'  => '保持当前良好的作息习惯和饮食方式，夏季多用补水控油的产品，冬季使用清爽型乳液精华等产品。适当饮水，每天饮水1200ml以上。可食用补充点维生素C+复合维生素B，饮食以清淡为主，忌辛辣油腻食品，多吃新鲜的水果和蔬菜。',
                ],
                self::OIL_LABEL_25 => [
                    'title'    => '化妆品影响',
                    'analysis' => '化妆品影响。测试部位的表层存在着化妆品或护肤品大量残留，导致当前测肤数据油分大于25%，当前数据不能完全真正体现此部位皮肤的油分情况。最好选取一块化妆品或护肤品残留较少的部位重新测肤。',
                    'suggest'  => '重新选取其他位置进行测肤。由于残留的大量护肤品或化妆品，测肤得出的数据不真实。最好重新选取一块化妆品或护肤品残留较少的部位重新测肤。',
                ],
                self::OIL_LABEL_30 => [
                    'title'    => '非皮肤油分',
                    'analysis' => '非皮肤油分。测试部位的表层存在大量油分或并非人体测肤指定部位导致皮肤数据显示油分大于30%，正常被测试的皮肤部位不可能存在此数据。请保持测试部位净洁无汗，并按正常的操作方式进行重新测试。',
                    'suggest'  => '重新测试此部位皮肤。由于测肤时，测试部位的表层存在大量油分或并非人体测肤指定部位导致数据不正常。在测肤前请保持测试部位净洁无汗，且测试部位正确。',
                ],
            ],
            'flex'  => [
                self::FLEX_LABEL_1 => [
                    'title'    => '松弛',
                    'analysis' => '肌肤弹性松弛，接触皮肤没有按压仪器设备导致结果或因为遗传、精神紧张、受阳光照射及吸烟等原因导致胶原蛋白和弹力纤维蛋白衰老而退化。皮肤出现松弛下垂，皮肤血液循环开始变慢，皮下组织脂肪层开始变得松弛而欠缺弹性，导致毛孔彰显。',
                    'suggest'  => '90%以上的皮肤松弛都是过度的阳光紫外线照射造成，时刻做足防晒工作。日常应注意每天彻底清洁皮肤，保持饮食均衡和充足的睡眠，减少抽烟酗酒。使用通过注射、口服或者多吃补充胶原蛋白的产品，可以使用提升紧致肌肤的护肤品。',
                ],
                self::FLEX_LABEL_3 => [
                    'title'    => '偏软',
                    'analysis' => '肌肤弹性偏软，可能由于年龄增长、过度的紫外线照射或精神紧张睡眠不足等原因，胶原蛋白和弹力纤维蛋白出现部分退化，皮肤血液循环变慢，导致皮下组织脂肪层弹性下降偏软。
生活作息、饮食没有养成良好的生活习惯也会影响皮肤弹性。',
                    'suggest'  => '日常保证充足的睡眠时间，饮食上多吃一些富含胶原蛋白的食物：鱼皮、猪蹄、鸡爪等。可出门可以适当涂一定的防晒霜或出门带遮阳伞，避免紫外线照射损伤皮肤。也需要注意日常皮肤清洁工作，适当考虑使用提升紧致肌肤的护肤品。',
                ],
                self::FLEX_LABEL_4 => [
                    'title'    => '良好',
                    'analysis' => '肌肤弹性良好，当前皮肤的胶原纤维和弹性纤维活力十足，皮肤内的血液循环系统运行正常，皮下组织脂肪层弹性良好，毛孔大小适中。保持当前的生活状态和皮肤护理方式，将会持续
保持皮肤的活力状态，此外注意日常的防晒工作。',
                    'suggest'  => '保持当前良好的作息习惯和饮食习惯，可适当吃含有维生素、蛋白质的产品保持胶原蛋白和弹力纤维蛋白的活性。日常注意防晒，适当涂抹一些防晒霜，阳光直射会促使黑色素活跃，导致黑斑等其他皮肤问题。',
                ],
                self::FLEX_LABEL_6 => [
                    'title'    => '偏硬',
                    'analysis' => '肌肤弹性偏硬，受护理不当或环境恶劣等其他影响，皮下组织脂肪层遭受破坏或者发生癌变。皮肤的胶原蛋白含水量下降，弹性纤维高易断裂，皮肤的血液流通受阻，代谢循环系统不正常，从而导致肌底组织变硬，皮肤才出现局部皱褶。',
                    'suggest'  => '使用促进新陈代谢的精油改善血液循环和新陈代谢，经常按摩皮肤也可以疏通活化组织肌肉，有效改变皮肤干硬状况。有条件可以考虑震动美容仪或离子美肤仪导出导入，按摩柔肤。避免长时间暴晒、高温或长时间浸泡水中，防止肌肤粗糙老化。',
                ],
                self::FLEX_LABEL_8 => [
                    'title'    => '超硬',
                    'analysis' => '肌肤弹性超硬，接触皮肤按压太用力导致结果或者皮肤受环境影响、护理不当等影响导致弹性纤维太高断裂。皮肤的血液流通堵塞，代谢循环系统混乱，皮肤的胶原蛋白短缺，从而导致肌底变得非常硬，出现皱纹和脆皮死皮。',
                    'suggest'  => '去医院检查是否是皮肤炎症或者其他皮肤问题。通过口服、涂抹或注射一些促进新陈代谢的产品改善血液循环和新陈代谢，也可以考虑震动美容仪或离子美肤仪导出导入，按摩柔化肌肤。注意平常肌肤的保护，避免暴晒、高温和寒冷等伤害。',
                ],
            ],
        ],
        self::EN => [
            'age'   => [
                'Young is capital, full of collagen',
                'Your skin is in good condition',
                'Collagen is slowly losing',
                'The skin is a bit loose',
                'Loss of skin moisture, loose skin！',
            ],
            'water' => [
                self::WATER_LABEL_5 => [
                    'title'    => 'Non-skin Data',
                    'analysis' => 'The device is not pressed tightly when contact with the skin or the test site is not designated for human skin test, resulting in data that is not human skin data. The actual skin moisture content of human body will not appear this data. Please test the skin and retest the skin in the normal operation.',
                    'suggest'  => 'Retest this area of skin. Due to the improper contact between the skin detector and the skin when the tester does not press the skin detector properly, or the test site is not designated for human skin test, the data is abnormal.',
                ],
                self::WATER_LABEL_10 => [
                    'title'    => 'Dry Skin',
                    'analysis' => 'Aging, environmental effects, excessive cleaning, sleep deprivation, and strong alkaline lotion are the main causes of skin dryness. The deep skin moisture is greatly reduced, the pore diastole secretes a lot of oil, the surface appears rough and dry, the local can appear dry crack, itchy, if scratch, can cause the skin to have the wound, causes the inflammation to form the acne.',
                    'suggest'  => 'Clean your skin with a gentle product. Use toner or moisturizer to moisturize your skin. If skin absorption ability is poor, use high concentration to hydrate original liquid and moisturize skin care products. Drink more water daily, avoid greasy and spicy, eat vitamin E, A, and B2 foods such as cabbage, animal liver, eggs and milk.',
                ],
                self::WATER_LABEL_30 => [
                    'title'    => 'Dehydrated',
                    'analysis' => 'Aging, environmental effects, excessive cleaning, sleep deprivation and strong alkaline lotion are the main reasons for skin moisture loss. Skin moisture loss causes pores to relax slightly, releasing more oil, and skin to become rough accordingly. The color of skin appears dark, dark and yellow, skin care products began to feel uncomfortable and not easy to absorb.',
                    'suggest'  => 'Your skin slight lack of water, ensure enough sleep and basic skin care, daily attention protection of air conditioning, sunlight and other effects on the skin, once a week can do facial mask and exfoliation, sensitive skin does not exfoliate. Use toner or moisturizer daily for hydration, drink lots of water and eat lots of fresh vegetables, fruits, eggs and milk.',
                ],
                self::WATER_LABEL_40 => [
                    'title'    => 'Great Condtion',
                    'analysis' => 'Daily attention to skin care and maintenance, avoid environmental impact, maintain adequate sleep and other good living habits so that skin moisture is good. The surface of skin is high in water, with small expansion degree of pores, sufficient oil secretion and strong ability to lock water in the surface. Skin appears smooth and delicate, ruddy and clear, skin can be broken by blow.',
                    'suggest'  => 'Keep current good work and rest habits and diet way, multi-purpose replenishment of water and oil control products in summer, use products such as refreshing emulsion essence in winter. Drink water properly, and drink more than 1200ml every day. Can edible a few improve water food such as honey, kiwi, apple, avoid tart and oily food.',
                ],
                self::WATER_LABEL_50 => [
                    'title'    => 'Cosmetic Effect',
                    'analysis' => 'There are a lot of residues of cosmetics or skin care products on the surface of the test site, leading to more than 50% moisture in the current skin test data. The current data cannot fully reflect the moisture of the skin in this site. It is best to choose a cosmetic or skin care products are less residual parts of the retest skin.',
                    'suggest'  => 'Select other locations for skin test. Because of the large number of skin care products or cosmetics residues, the data obtained by skin testing is not true. It is best to re-select a part of cosmetics or skin care products that has less residue to retest the skin.',
                ],
                self::WATER_LABEL_60 => [
                    'title'    => 'Non-skin Data',
                    'analysis' => 'The skin data showed that the surface of the test site had a large amount of water or was not designated by human skin testing, which could not exist in the normally tested skin. Please keep the test site clean and sweat-free and retest as normal operation.',
                    'suggest'  => 'Retest this area of skin. Due to the presence of large amounts of water on the surface of the test site during skin testing or the non-designated site for human skin testing, the data is abnormal. Please keep the test site clean and free of sweat before skin test, and the test site is correct.',
                ],
            ],
            'oil'   => [
                self::OIL_LABEL_5 => [
                    'title'    => 'Non-skin Data',
                    'analysis' => 'The device is not pressed tightly when contact with the skin or the test site is not designated for human skin test, resulting in data that is not human skin data. The actual skin oil score of human body will not show this data. Please test the skin and retest the skin in the normal operation.',
                    'suggest'  => 'Retest this area of skin. Due to the improper contact between the skin detector and the skin when the tester does not press the skin detector properly, or the test site is not designated for human skin test, the data is abnormal.',
                ],
                self::OIL_LABEL_10 => [
                    'title'    => 'Malnutrient',
                    'analysis' => 'Affected by environment, disorder of work and rest, greasy and spicy diet, improper care and cleaning, etc., the skin can absorb malnutrition, slow blood circulation, and lose water and oil seriously. Skin surface can not be protected by moisture and oil, the skin presents local dry and hard, forming dead cutin skin, rough forming wrinkles.',
                    'suggest'  => 'Use a deep cleansing routine to remove excess cutin and dead skin. In summer, use water replenishing and oil control products, and in winter, use refreshing emulsion essence and other products. Avoid smoking, drinking, staying up late, drinking more than 1200ml daily water. On the food with light give priority to, avoid acrimony fat food, eat a few fresh fruit and vegetable more.',
                ],
                self::OIL_LABEL_15 => [
                    'title'    => 'Slightly Oily ',
                    'analysis' => 'Due to the influence of environment, disorder of work and rest, greasy and spicy diet, improper care and cleaning, the skin\'s absorption rate of nutrition becomes slow, slight obstruction of blood circulation occurs, skin moisture is lost, pores develop and secrete oil deficiency, and the skin presents the state of local dryness and lack of oil.',
                    'suggest'  => 'Clean the top layer of skin effectively, removing extraneous cutin and dead skin. In daily care can use the moisturizing oil control ingredients of nursing products such as emulsion, essence, frost products. Ensure regular sleep quality, do not smoke and drink alcohol, drink more water. Diet to light - based, avoid spicy greasy, eat more fresh fruits and vegetables.',
                ],
                self::OIL_LABEL_18 => [
                    'title'    => 'Pretty Good',
                    'analysis' => 'Daily attention to skin care and maintenance, avoid environmental impact, maintain adequate sleep and other good living habits so that skin oil is good. The skin\'s surface is well hydrated, the pore expands degree is small, the skin body fluid is full the cell is substantial, the metabolism is normal, the blood circulation is good, the secretion oil cent is sufficient.',
                    'suggest'  => 'Keep current good work and rest habits and diet way, multi-purpose replenishment of water and oil control products in summer, use products such as refreshing emulsion essence in winter. Drink water properly, and drink more than 1200ml every day. Can edible complement bit vitamin C+ compound vitamin B, the food is given priority to with light, avoid acrimony fat food, eat fresh fruit and vegetable more.',
                ],
                self::OIL_LABEL_25 => [
                    'title'    => 'Cosmetic Effect',
                    'analysis' => 'There are a lot of residues of cosmetics or skin care products on the surface of the test site, resulting in the oil content of the current skin test data greater than 25%. The current data cannot fully reflect the oil content of the skin in this site. It is best to choose a cosmetic or skin care products are less residual parts of the retest skin.',
                    'suggest'  => 'Select other locations for skin test. Because of the large number of skin care products or cosmetics residues, the data obtained by skin testing is not true. It is best to re-select a part of cosmetics or skin care products that has less residue to retest the skin.',
                ],
                self::OIL_LABEL_30 => [
                    'title'    => 'Non-skin Data',
                    'analysis' => 'The skin data of the test site showed that the oil score was more than 30% due to the presence of a large amount of oil on the surface of the test site or the part not designated by human skin test. This data could not exist in the normally tested skin site. Please keep the test site clean and sweat-free and retest as normal operation.',
                    'suggest'  => 'Retest this area of skin. Because there is a lot of oil in the surface of the test site or the designated part of the human body test site, the data is abnormal. Please keep the test site clean and free of sweat before skin test, and the test site is correct.',
                ],
            ],
            'flex'  => [
                self::FLEX_LABEL_1 => [
                    'title'    => 'Loose',
                    'analysis' => 'Failure to press the device on contact with the skin results in deterioration of collagen and elastin due to genetic, nervous, sun exposure and smoking. Skin appears flabby prolapse, skin blood circulation begins to slow, subcutaneous tissue adipose layer begins to become flabby and lack flexibility, bring about pore to reveal.',
                    'suggest'  => 'More than 90 per cent of skin flabby is caused by excessive sun exposure, and is always fully protected from the sun. Daily attention should be paid to thoroughly clean the skin every day, maintain a balanced diet and adequate sleep, reduce smoking and drinking. Skin care products that tighten the skin can be used with products that are injected, taken orally, or taken with collagen supplements.',
                ],
                self::FLEX_LABEL_3 => [
                    'title'    => 'Sloppy',
                    'analysis' => 'It is possible that due to aging, excessive ultraviolet irradiation or nervous sleep shortage, collagen and elastin show partial degeneration and slow blood circulation in the skin, resulting in soft elasticity of the adipose layer of the subcutaneous tissue. Living and rest, diet does not form a good life habit also can affect skin elasticity.',
                    'suggest'  => 'Get enough sleep and eat a diet rich in collagen: fish skin, pig\'s feet, chicken feet, etc. Can go out can apply certain sunscreen appropriately or go out to take sunshade umbrella, avoid ultraviolet ray to illuminate damages the skin. It is also necessary to pay attention to daily skin cleaning and properly consider using skin care products that enhance the firmness of the skin.',
                ],
                self::FLEX_LABEL_4 => [
                    'title'    => 'Great',
                    'analysis' => 'At present, the skin\'s collagen fibers and elastic fibers are full of vitality. The blood circulation system in the skin runs normally. Maintaining your current lifestyle and skin care will maintain your skin\'s vitality and look out for daily sun protection.',
                    'suggest'  => 'Maintain current good daily habits and eating habits, can properly eat vitamin, protein products to maintain the activity of collagen and elastin. Take care of daily sun protection and apply some sunscreen appropriately. Direct sunlight will promote the activity of melanin, resulting in other skin problems such as dark spots.',
                ],
                self::FLEX_LABEL_6 => [
                    'title'    => 'Harden',
                    'analysis' => 'The fat layer of subcutaneous tissue is damaged or becomes cancerous due to improper care or poor environment. The skin\'s collagen contains less water, the elastic fibers are highly likely to break, the skin\'s blood circulation is blocked, and the metabolic circulation system is not normal, which leads to the hardening of the underlying muscle tissue and local folds of the skin.',
                    'suggest'  => 'Use the essential oil that promotes metabolism to improve blood circulation and metabolism, often massage the skin also can dredge activation tissue muscle, change the skin dry and hard condition effectively. The condition may consider the vibration cosmetology instrument or the ion beautician export import, massages the skin soft. Avoid long time insolation, high temperature or long time immersion water, prevent skin rough aging.',
                ],
                self::FLEX_LABEL_8 => [
                    'title'    => 'Rough',
                    'analysis' => 'Too much pressure on the skin can lead to the result or the skin is affected by the environment, improper care and so on. The skin\'s blood circulation is blocked, the metabolic circulatory system is chaotic, and the skin\'s collagen is in short supply, resulting in the muscular base becoming very hard, with wrinkles and brittle dead skin.',
                    'suggest'  => 'Go to the hospital to check for skin inflammation or other skin problems. Improve blood circulation and metabolism through oral application, application or injection of some products that promote metabolism. Also consider the export and import of vibrator and ion skin-beautifier to massage and soften the skin. Pay attention to the protection of ordinary skin, avoid sun exposure, heat and cold injuries.',
                ],
            ],
        ],
        self::HK => [
            'age'   => [
                '年輕就是資本，滿滿膠原蛋白，為你打call!',
                '確認過眼神，你目前皮膚狀態良好。',
                '膠原蛋白在慢慢流失了，要學會“diss”它',
                '皮膚有點鬆弛了，穩住，你能贏的！',
                '肌膚水分流失嚴重，皮膚鬆弛，扎心了，老鐵！',
            ],
            'water' => [
                self::WATER_LABEL_5 => [
                    'title'    => '非皮膚水分',
                    'analysis' => '非皮膚水分。接觸皮膚時沒有按壓緊儀器設備或者測試部位並非人體測膚指定部位導致數據並非人體皮膚數據，人體真實的皮膚含水量不會出現此數據。請按正常的操作管道進行測膚和重新測試此部位皮膚。',
                    'suggest'  => '重新測試此部位皮膚。由於測膚時，測試人員未按壓好測膚儀器導致接觸測膚儀器與皮膚接觸不恰當，或測試部位並非人體測膚指定部位導致數據不正常。',
                ],
                self::WATER_LABEL_10 => [
                    'title'    => '肌膚乾燥',
                    'analysis' => '肌膚乾燥。年齡增長、環境影響、清潔過度、睡眠不足、洗劑用品鹼性强等是導致皮膚乾燥的重要原因。皮膚深層水分大量减少，毛孔舒張分泌大量油分，表層呈現粗糙乾燥，局部會出現乾裂、發癢，若是抓癢，會導致皮膚有傷口，引起發炎形成青春痘。',
                    'suggest'  => '以溫和產品清潔皮膚，日常多使用爽膚水或保濕乳對皮膚補水，每天睡前做一次補水面膜或精華按摩。若肌膚吸收能力差，使用高濃度補水原液和滋潤護膚品。日常多飲水，忌油膩辛辣，食用維他命E、A、和B2的食物如捲心菜、動物肝臟、雞蛋和牛奶等。',
                ],
                self::WATER_LABEL_30 => [
                    'title'    => '水分不足',
                    'analysis' => '水分不足。年齡增長、環境影響、清潔過度、睡眠不足、洗劑用品鹼性强等是導致皮膚流失水分的重要原因。皮膚水分流失會導致毛孔輕度舒張，釋放更多的油分，肌膚也相應變得粗糙。膚色呈現暗沉泛黃，對護膚品開始有不適感和不易吸收。',
                    'suggest'  => '你的肌膚輕微缺水，保證充足睡眠和基本的皮膚護理，日常注意防護空調、陽光等對皮膚影響，每週可以去做一次面膜和去角質，敏感皮膚可不去角質。日常使用爽膚水或保濕乳進行補水，多飲水和多吃新鮮的蔬菜、水果、雞蛋和牛奶等。',
                ],
                self::WATER_LABEL_40 => [
                    'title'    => '水分良好',
                    'analysis' => '水分良好。日常注意皮膚護理和保養，避免環境影響、保持充足睡眠等良好的生活習慣使皮膚水分良好。皮膚表層含水量高，毛孔展開程度小，分泌油分充足，表層鎖水能力强。皮膚呈現光滑細嫩，紅潤通透，肌膚吹彈可破。',
                    'suggest'  => '保持當前良好的作息習慣和飲食管道，夏季多用補水控油的產品，冬季使用清爽型乳液精華等產品。適當飲水，每天飲水1200ml以上。可食用一些改善水分的食品如蜂蜜、奇異果、蘋果等，忌辛辣油膩食品。',
                ],
                self::WATER_LABEL_50 => [
                    'title'    => '化妝品影響',
                    'analysis' => '化妝品影響。測試部位的表層存在著化妝品或護膚品大量殘留，導致當前測膚數據水分大於50%，當前數據不能完全真正體現此部位皮膚的水分情况。最好選取一塊化妝品或護膚品殘留較少的部位重新測膚。',
                    'suggest'  => '重新選取其他位置進行測膚。由於殘留的大量護膚品或化妝品，測膚得出的數據不真實。最好重新選取一塊化妝品或護膚品殘留較少的部位重新測膚。',
                ],
                self::WATER_LABEL_60 => [
                    'title'    => '非皮膚水分',
                    'analysis' => '非皮膚水分。測試部位的表層存在大量水分或並非人體測膚指定部位導致皮膚資料顯示水分大於60%，正常被測試的皮膚部位不可能存在此數據。請保持測試部位淨潔無汗，並按正常的操作管道進行重新測試。',
                    'suggest'  => '重新測試此部位皮膚。由於測膚時，測試部位的表層存在大量水分或並非人體測膚指定部位導致數據不正常。在測膚前請保持測試部位淨潔無汗，且測試部位正確。',
                ],
            ],
            'oil'   => [
                self::OIL_LABEL_5 => [
                    'title'    => '非皮膚油分',
                    'analysis' => '非皮膚油分。接觸皮膚時沒有按壓緊儀器設備或者測試部位並非人體測膚指定部位導致數據並非人體皮膚數據，人體真實的皮膚油分不會出現此數據。請按正常的操作管道進行測膚和重新測試此部位皮膚。',
                    'suggest'  => '重新測試此部位皮膚。由於測膚時，測試人員未按壓好測膚儀器導致接觸測膚儀器與皮膚接觸不恰當，或測試部位並非人體測膚指定部位導致數據不正常。',
                ],
                self::OIL_LABEL_10 => [
                    'title'    => '營養不良',
                    'analysis' => '營養不良。受環境、作息混亂、飲食油膩辛辣、護理清潔不當等原因影響導致肌膚吸收營養不良，血液迴圈變慢，水分和油分流失嚴重。皮膚表層無法受到水分和油分保護，肌膚呈現局部幹硬，形成角質死皮，粗糙形成皺紋。',
                    'suggest'  => '日常對皮膚進行深度清潔，去除多餘的角質和死皮。夏季多用補水控油的產品，冬季多用清爽型乳液精華等產品。忌抽烟喝酒熬夜，日常飲水1200ml以上。飲食上以清淡為主，忌辛辣油膩的食物，多吃一些新鮮水果和蔬菜。',
                ],
                self::OIL_LABEL_15 => [
                    'title'    => '缺油',
                    'analysis' => '皮膚輕度缺油。受環境、作息混亂、飲食油膩辛辣、護理清潔不當等原因影響導致肌膚吸收營養速率變慢，血液迴圈出現輕微阻礙，皮膚水分遺失，毛孔展開分泌油分不足，皮膚呈現局部乾燥缺油的狀態。',
                    'suggest'  => '對皮膚表層進行有效清潔，去除多餘的角質和死皮。日常護理中可使用補水控油成分的護理產品如乳液、精華、霜類產品等。保證平常睡眠品質，不抽烟喝酒，多飲水。飲食以清淡為主，忌辛辣油膩，多食用一些新鮮水果和蔬菜。',
                ],
                self::OIL_LABEL_18 => [
                    'title'    => '油分良好',
                    'analysis' => '油分良好。日常注意皮膚護理和保養，避免環境影響、保持充足睡眠等良好的生活習慣使皮膚油分良好。皮膚表層水分良好，毛孔展開程度小，皮膚體液飽滿細胞充實、新陳代謝正常、血液迴圈好，分泌油分充足。',
                    'suggest'  => '保持當前良好的作息習慣和飲食管道，夏季多用補水控油的產品，冬季使用清爽型乳液精華等產品。適當飲水，每天飲水1200ml以上。可食用補充點維他命C+複合維生素B，飲食以清淡為主，忌辛辣油膩食品，多吃新鮮的水果和蔬菜。',
                ],
                self::OIL_LABEL_25 => [
                    'title'    => '化妝品影響',
                    'analysis' => '化妝品影響。測試部位的表層存在著化妝品或護膚品大量殘留，導致當前測膚數據油分大於25%，當前數據不能完全真正體現此部位皮膚的油分情况。最好選取一塊化妝品或護膚品殘留較少的部位重新測膚。',
                    'suggest'  => '重新選取其他位置進行測膚。由於殘留的大量護膚品或化妝品，測膚得出的數據不真實。最好重新選取一塊化妝品或護膚品殘留較少的部位重新測膚。',
                ],
                self::OIL_LABEL_30 => [
                    'title'    => '非皮膚油分',
                    'analysis' => '非皮膚油分。測試部位的表層存在大量油分或並非人體測膚指定部位導致皮膚資料顯示油分大於30%，正常被測試的皮膚部位不可能存在此數據。請保持測試部位淨潔無汗，並按正常的操作管道進行重新測試。',
                    'suggest'  => '重新測試此部位皮膚。由於測膚時，測試部位的表層存在大量油分或並非人體測膚指定部位導致數據不正常。在測膚前請保持測試部位淨潔無汗，且測試部位正確。',
                ],
            ],
            'flex'  => [
                self::FLEX_LABEL_1 => [
                    'title'    => '鬆弛',
                    'analysis' => '肌膚彈性鬆弛，接觸皮膚沒有按壓儀器設備導致結果或因為遺傳、精神緊張、受陽光照射及吸烟等原因導致膠原蛋白和彈力纖維蛋白衰老而退化。皮膚出現鬆弛下垂，皮膚血液迴圈開始變慢，皮下組織脂肪層開始變得鬆弛而欠缺彈性，導致毛孔彰顯。',
                    'suggest'  => '90%以上的皮膚鬆弛都是過度的陽光紫外線照射造成，時刻做足防曬工作。日常應注意每天徹底清潔皮膚，保持飲食均衡和充足的睡眠，减少抽烟酗酒。使用通過注射、口服或者多吃補充膠原蛋白的產品，可以使用提升緊致肌膚的護膚品。',
                ],
                self::FLEX_LABEL_3 => [
                    'title'    => '偏軟',
                    'analysis' => '肌膚彈性偏軟，可能由於年齡增長、過度的紫外線照射或精神緊張睡眠不足等原因，膠原蛋白和彈力纖維蛋白出現部分退化，皮膚血液迴圈變慢，導致皮下組織脂肪層彈性下降偏軟。生活作息、飲食沒有養成良好的生活習慣也會影響皮膚彈性。',
                    'suggest'  => '日常保證充足的睡眠時間，飲食上多吃一些富含膠原蛋白的食物：魚皮、猪蹄、雞爪等。可出門可以適當塗一定的防曬霜或出門帶遮陽傘，避免紫外線照射損傷皮膚。也需要注意日常皮膚清潔工作，適當考慮使用提升緊致肌膚的護膚品。',
                ],
                self::FLEX_LABEL_4 => [
                    'title'    => '良好',
                    'analysis' => '肌膚彈性良好，當前皮膚的膠原纖維和彈性纖維活力十足，皮膚內的血液迴圈系統運行正常，皮下組織脂肪層彈性良好，毛孔大小適中。保持當前的生活狀態和皮膚護理管道，將會持續保持皮膚的活力狀態，此外注意日常的防曬工作。',
                    'suggest'  => '保持當前良好的作息習慣和飲食習慣，可適當吃含有維他命、蛋白質的產品保持膠原蛋白和彈力纖維蛋白的活性。日常注意防曬，適當塗抹一些防曬霜，陽光直射會促使黑色素活躍，導致黑斑等其他皮膚問題。',
                ],
                self::FLEX_LABEL_6 => [
                    'title'    => '偏硬',
                    'analysis' => '肌膚彈性偏硬，受護理不當或環境惡劣等其他影響，皮下組織脂肪層遭受破壞或者發生癌變。皮膚的膠原蛋白含水量下降，彈性纖維高易斷裂，皮膚的血液流通受阻，代謝循環系統不正常，從而導致肌底組織變硬，皮膚才出現局部皺褶。',
                    'suggest'  => '使用促進新陳代謝的精油改善血液迴圈和新陳代謝，經常按摩皮膚也可以疏通活化組織肌肉，有效改變皮膚幹硬狀況。有條件可以考慮震動美容儀或離子美膚儀匯出導入，按摩柔膚。避免長時間暴曬、高溫或長時間浸泡水中，防止肌膚粗糙老化。',
                ],
                self::FLEX_LABEL_8 => [
                    'title'    => '超硬',
                    'analysis' => '肌膚彈性超硬，接觸皮膚按壓太用力導致結果或者皮膚受環境影響、護理不當等影響導致彈性纖維太高斷裂。皮膚的血液流通堵塞，代謝循環系統混亂，皮膚的膠原蛋白短缺，從而導致肌底變得非常硬，出現皺紋和脆皮死皮。',
                    'suggest'  => '去醫院檢查是否是皮膚炎症或者其他皮膚問題。通過口服、塗抹或注射一些促進新陳代謝的產品改善血液迴圈和新陳代謝，也可以考慮震動美容儀或離子美膚儀匯出導入，按摩柔化肌膚。注意平常肌膚的保護，避免暴曬、高溫和寒冷等傷害。',
                ],
            ],
        ],
    ];

    const FLEX_LABEL_8 = 'flex_label_8';
    const FLEX_LABEL_6 = 'flex_label_6';
    const FLEX_LABEL_4 = 'flex_label_4';
    const FLEX_LABEL_3 = 'flex_label_3';
    const FLEX_LABEL_1 = 'flex_label_1';


    const FLEX_LABEL_MAP = [
        self::FLEX_LABEL_8 ,
        self::FLEX_LABEL_6 ,
        self::FLEX_LABEL_4 ,
        self::FLEX_LABEL_3 ,
        self::FLEX_LABEL_1 ,
    ];

    const FLEX_GOOD_LABELS = [
        self::FLEX_LABEL_8,
        self::FLEX_LABEL_6,
        self::FLEX_LABEL_4,
    ];

    const OIL_LABEL_30 = 'oil_label_30';
    const OIL_LABEL_25 = 'oil_label_25';
    const OIL_LABEL_18 = 'oil_label_18';
    const OIL_LABEL_15 = 'oil_label_15';
    const OIL_LABEL_10 = 'oil_label_10';
    const OIL_LABEL_5  = 'oil_label_5';

    const OIL_LABEL_MAP = [
        self::OIL_LABEL_30 ,
        self::OIL_LABEL_25 ,
        self::OIL_LABEL_18 ,
        self::OIL_LABEL_15 ,
        self::OIL_LABEL_10 ,
        self::OIL_LABEL_5 ,
    ];

    const OIL_GOOD_LABELS = [
        self::OIL_LABEL_18,
        self::OIL_LABEL_15,
        self::OIL_LABEL_10,
        self::OIL_LABEL_5,
    ];

    const WATER_LABEL_60 = 'water_label_60';
    const WATER_LABEL_50 = 'water_label_50';
    const WATER_LABEL_40 = 'water_label_40';
    const WATER_LABEL_30 = 'water_label_30';
    const WATER_LABEL_10 = 'water_label_10';
    const WATER_LABEL_5  = 'water_label_5';

    const WATER_LABEL_MAP = [
        self::WATER_LABEL_60 ,
        self::WATER_LABEL_50 ,
        self::WATER_LABEL_40 ,
        self::WATER_LABEL_30 ,
        self::WATER_LABEL_10 ,
        self::WATER_LABEL_5 ,
    ];

    const WATER_GOOD_LABELS = [
        self::WATER_LABEL_60,
        self::WATER_LABEL_50,
        self::WATER_LABEL_40,
    ];

    const ZH = 'zh-CN';
    const EN = 'en';
    const HK = 'zh-HK';

    const LABEL_WATER = 'water';
    const LABEL_FLEX = 'flex';
    const LABEL_OIL = 'oil';

    const ITEM_LABELS = [
        self::LABEL_WATER,
        self::LABEL_FLEX,
        self::LABEL_OIL,
    ];
    /**
     * @deprecated (废弃了，改用下面的：transScoreTitleByCustom)
     * @param string|'water'|'oil'|'flex' $label
     * @param float $score
     *
     * @return string
     */
    public static function transScoreTitle(string $label, float $score): string
    {
        switch ($label) {
            case self::LABEL_WATER :
                $label_key = self::waterLabelKey($score);
                break;
            case self::LABEL_OIL :
                $label_key = self::oilLabelKey($score);
                break;
            case self::LABEL_FLEX :
                $label_key = self::flexLabelKey($score);
                break;
            default :
                throw new \InvalidArgumentException('invalidate hm item name');
        }

        $local_report = self::appLocaleReportMap();

        return $local_report[$label][$label_key]['title'];
    }

    /**
     * @param float $score
     *
     * @return string
     */
    public static function flexLabelKey(float $score): string
    {
        if ($score >= 8) {
            return self::FLEX_LABEL_8;
        } else if ($score >= 6) {
            return self::FLEX_LABEL_6;
        } else if ($score >= 4) {
            return self::FLEX_LABEL_4;
        } else if ($score >= 3) {
            return self::FLEX_LABEL_3;
        } else if ($score < 3) {
            return self::FLEX_LABEL_1;
        }

        throw new \InvalidArgumentException('invalidate score value');
    }

    public static function flexLabelWhereRange(string $label_key): array
    {
        return [
            self::FLEX_LABEL_8 => [
                ['flex', '>=', '8'],
            ],
            self::FLEX_LABEL_6 => [
                ['flex', '<', '8'],
                ['flex', '>=', '6'],
            ],
            self::FLEX_LABEL_4 => [
                ['flex', '<', '6'],
                ['flex', '>=', '4'],
            ],
            self::FLEX_LABEL_3 => [
                ['flex', '<', '4'],
                ['flex', '>=', '3'],
            ],
            self::FLEX_LABEL_1 => [
                ['flex', '<', '3'],
            ],
        ][$label_key];
    }

    public static function oilLabelKey(float $score): string
    {
        if ($score >= 30) {
            return self::OIL_LABEL_30;
        } else if ($score >= 25) {
            return self::OIL_LABEL_25;
        } else if ($score >= 18) {
            return self::OIL_LABEL_18;
        } else if ($score >= 15) {
            return self::OIL_LABEL_15;
        } else if ($score >= 10) {
            return self::OIL_LABEL_10;
        } else if ($score < 10) {
            return self::OIL_LABEL_5;
        }

        throw new \InvalidArgumentException('invalidate score value');
    }

    public static function oilLabelWhereRange(string $label_key): array
    {
        return [
            self::OIL_LABEL_30 => [
                ['oil', '>=', '30'],
            ],
            self::OIL_LABEL_25 => [
                ['oil', '<', '30'],
                ['oil', '>=', '25'],
            ],
            self::OIL_LABEL_18 => [
                ['oil', '<', '25'],
                ['oil', '>=', '18'],
            ],
            self::OIL_LABEL_15 => [
                ['oil', '<', '18'],
                ['oil', '>=', '15'],
            ],
            self::OIL_LABEL_10 => [
                ['oil', '<', '15'],
                ['oil', '>=', '10'],
            ],
            self::OIL_LABEL_5  => [
                ['oil', '<', '10'],
            ],
        ][$label_key];
    }

    public static function waterLabelKey(float $score): string
    {
        if ($score >= 60) {
            return self::WATER_LABEL_60;
        } else if ($score >= 50) {
            return self::WATER_LABEL_50;
        } else if ($score >= 40) {
            return self::WATER_LABEL_40;
        } else if ($score >= 30) {
            return self::WATER_LABEL_30;
        } else if ($score >= 10) {
            return self::WATER_LABEL_10;
        } else if ($score < 10) {
            return self::WATER_LABEL_5;
        }

        throw new \InvalidArgumentException('invalidate score value');
    }

    public static function waterLabelWhereRange(string $label_key): array
    {
        return [
            self::WATER_LABEL_60 => [
                ['water', '>=', '60'],
            ],
            self::WATER_LABEL_50 => [
                ['water', '<', '60'],
                ['water', '>=', '50'],
            ],
            self::WATER_LABEL_40 => [
                ['water', '<', '50'],
                ['water', '>=', '40'],
            ],
            self::WATER_LABEL_30 => [
                ['water', '<', '40'],
                ['water', '>=', '30'],
            ],
            self::WATER_LABEL_10 => [
                ['water', '<', '30'],
                ['water', '>=', '10'],
            ],
            self::WATER_LABEL_5  => [
                ['water', '<', '10'],
            ],
        ][$label_key];
    }

    /**
     * @param string $label
     * @param string $label_key
     *
     * @return array
     * @throws \Exception
     */
    public static function skinRecordWhereRangeByLabelKey(string $label, string $label_key): array
    {
        switch ($label) {
            case self::LABEL_FLEX :
                return self::flexLabelWhereRange($label_key);
            case self::LABEL_WATER :
                return self::waterLabelWhereRange($label_key);
            case self::LABEL_OIL :
                return self::oilLabelWhereRange($label_key);
            default :
                throw new ApiException(ApiErrCode::REQUEST_PARAMS_ERROR, 'invalidate hm label key for query');
        }
    }

    /**
     * @return string
     */
    private static function appReportLocale(): string
    {
        return app()->getLocale();
    }

    /**
     * @return array
     */
    public static function appLocaleReportMap(): array
    {
        return self::REPORT_MAP[self::appReportLocale()];
    }

    /**
     * check water/oil/flex is good
     *
     * @param HmSkinRecord $hm_skin_record
     * @return bool
     */
    public static function checkAllLabelIsGood(HmSkinRecord $hm_skin_record): bool
    {
        $water_is_good = in_array(self::waterLabelKey($hm_skin_record->water), self::WATER_GOOD_LABELS);
        $oil_is_good = in_array(self::oilLabelKey($hm_skin_record->oil), self::OIL_GOOD_LABELS);
        $flex_is_good  = in_array(self::flexLabelKey($hm_skin_record->flex), self::FLEX_GOOD_LABELS);

        return $water_is_good && $oil_is_good && $flex_is_good;
    }

    /**
     * @param int $item_id
     * @param $score
     * @param $customer_id
     * @return string|null
     */
    public static function transScoreTitleByCustom(int $item_id, $score, $customer_id): ?string
    {
        $level_sort = self::hmItemLevelSort($item_id, $score);

        $suggests = self::getHmSkinSuggest($customer_id);

        $hm_suggest = $suggests->where('detection_type_id', $item_id)
            ->where('level_sort', $level_sort)
//            ->where('position_id', $position_id) // 不同部位，对应的title是一样的，不用处理部位了。
            ->first();

        return $hm_suggest->title ?? null;
    }

    /**
     * @param string $item_name
     * @param $level_sort
     * @return array
     */
    public static function hmItemLevelSortWhereRange(string $item_name, $level_sort): array
    {
        $item_id = array_flip(self::HM_ITEM_NAME_MAP)[$item_name];
        $item_value_range = self::HM_DETECTION_LEVEL_MAP[$item_id];

        $count = count($item_value_range);
        $where = [];
        foreach($item_value_range as $index => $item_level_sort)
        {
            if (($item_level_sort !== (int)$level_sort)) { continue; }

            if ($index == 0) {
                $where = [[$item_name, '<', $item_value_range[$index+1]]];
                break;
            } else if ($index == $count-1){
                $where = [[$item_name, '>', $item_value_range[$index]]];
                break;
            } else {
                $where = [
                    [$item_name, '<', $item_value_range[$index+1]],
                    [$item_name, '>=', $item_level_sort],
                ];
                break;
            }
        }

        return $where;
    }

    /**
     * @param $item_id
     * @param $score
     * @return mixed
     */
    public static function hmItemLevelSort($item_id, $score)
    {
        $item_value_range = self::HM_DETECTION_LEVEL_MAP[$item_id];

        if (in_array($score, $item_value_range)) {
            $level_sort = $score;
        } else {
            array_push($item_value_range, $score);
            sort($item_value_range);

            $key = array_search($score, $item_value_range);
            $index = ($key===0) ? 1 : ($key-1);
            $level_sort = $item_value_range[$index];
        }

        return $level_sort;
    }

    /**
     * @param $customer_id
     * @return Collection
     */
    public static function getHmSkinSuggest($customer_id)
    {
        if (self::$hm_suggests) return self::$hm_suggests;

        $language_code = app()->getLocale();
        $language_id = ModelLanguage::getLanguageIds()[$language_code];

        $customer_id = CustomerRelateHmSkin::hasHmSkinSuggest($customer_id);

        /** @var Collection $hm_skin_suggests */
        $hm_skin_suggests = HmSkinSuggest::where('language_id', $language_id)
            ->whereHas('customerRelateHmSkin', function($query) use($customer_id){
                return $query->where('customer_id', $customer_id)
                    ->where('store_id', CustomerRelateHmSkin::STORE_ID_DEFAULT);
            })
            ->with('customerRelateHmSkin')
            ->get();

        $hm_skin_suggests->transform(function(HmSkinSuggest $hm_skin_suggest){
            $hm_skin_suggest->detection_type_id = $hm_skin_suggest->customerRelateHmSkin->detection_type_id;
            $hm_skin_suggest->level_sort = $hm_skin_suggest->customerRelateHmSkin->level_sort;
            $hm_skin_suggest->position_id = $hm_skin_suggest->customerRelateHmSkin->position_id;

            $hm_skin_suggest->addHidden('customerRelateHmSkin');

            return $hm_skin_suggest;
        });

        self::$hm_suggests = $hm_skin_suggests;

        return $hm_skin_suggests;
    }
}